#include <stdio.h>

#include <node_api.h>

extern "C"
__attribute__((visibility("default")))
napi_value napi_demo_register_module(napi_env env, napi_value exports)
{
    printf("loaded\n");
    return exports;
}

static napi_module g_napiModule = {
    .nm_version = 1,
    .nm_flags = 0,
    .nm_filename = __FILE__,
    .nm_register_func = napi_demo_register_module,
    .nm_modname = "NODE_GYP_MODULE_NAME",
    .nm_priv = {},
    .reserved = {},
};

__attribute__((constructor))
static void Init(void)
{
    napi_module_register(&g_napiModule);
}
